find_files

This function returns all files found matching a specified search pattern.

string[] find_files(string search)

Parameters:
search
The search pattern that is to be used when looking for files.

Return value:
Returns an array of file names that match the specified search pattern, or an empty array on failure.

Remarks:
Wildcards are accepted in the search term. An asterisk (* sign) indicates 0 or more unknown characters while a question mark (? sign) represents up to 1 unknown character.

Please note that this function will only find files. To find directories, use the find_directories function.

When searching using a 3-character extension, any extension starting with those 3 characters will match, even if it contains additional characters. For instance, "*.ogg" will match "test.ogg", "sound.oggs" or "bang.oggy", that is of course assuming those files exist.

If an empty string is passed as a parameter, the function will assume the search term "*" which is to say all files in the current directory.

This function will accept absolute or relative paths.

The search term is not case sensitive.

Please note that the path may not end in a trailing slash or backslash.

Example:
// Find all files in the windows media folder.

void main()
{
string[] test;
test=find_files("C:\\windows/media/*.*");
for(uint counter=0; counter<test.length(); counter++)
{
alert("array", "array "+counter+"="+test[counter]);
}
}